home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / 000167_amos-request@svcs1.digex.net_Sun Apr 20 11:28:08 1997.msg < prev    next >
Text File  |  1998-06-24  |  4KB  |  81 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id LAA23742
  3.     for <mcox@access.digex.net>; Sun, 20 Apr 1997 11:28:07 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id KAA05428
  6.     for amos-out; Sun, 20 Apr 1997 10:14:49 -0400 (EDT)
  7. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id KAA05425
  9.     for <amos-list@svcs1.digex.net>; Sun, 20 Apr 1997 10:14:48 -0400 (EDT)
  10. Received: from kruuna.Helsinki.FI (palaste@kruuna.helsinki.fi [128.214.180.131])
  11.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id KAA12740
  12.     for <amos-list@access.digex.net>; Sun, 20 Apr 1997 10:14:46 -0400 (EDT)
  13. Received: from localhost (palaste@localhost) by kruuna.Helsinki.FI (8.8.5/8.8.0) with SMTP id RAA27187; Sun, 20 Apr 1997 17:14:41 +0300 (EET DST)
  14. X-Authentication-Warning: kruuna.Helsinki.FI: palaste owned process doing -bs
  15. Date: Sun, 20 Apr 1997 17:14:40 +0300 (EET DST)
  16. From: Joona I Palaste <palaste@cc.helsinki.fi>
  17. X-Sender: palaste@kruuna.Helsinki.FI
  18. To: Stephen W Williams <stevewil@stevewil.demon.co.uk>
  19. cc: amos-list@access.digex.net
  20. Subject: Re: Printing to file
  21. In-Reply-To: <1597.7049T592T551@stevewil.demon.co.uk>
  22. Message-ID: <Pine.SOL.3.96.970420171245.26536C-100000@kruuna.Helsinki.FI>
  23. MIME-Version: 1.0
  24. Content-Type: TEXT/PLAIN; charset=US-ASCII
  25. Status: RO
  26. X-Status: 
  27.  
  28. On 20 Apr 1997, Stephen W Williams wrote:
  29.  
  30. > To All 
  31. > Can someone help me with a small but irritating problem I am having
  32. > with a little prog I am trying to get working.
  33. > What I want to do is use AmosPro to create a file in Ram called Datapath
  34. > and then execute it with Amiga dos.
  35. > If you look at the example below it should create a file called Datapath
  36. > containing "CD workbench:data".
  37. > Now the hard part, the file should change the current directory to 
  38. > workbench:data (which does exist on my system).
  39. > But What I get is "object not found  CD failed returncode 20",
  40. > I think I have found why it doesn't run because there seems to be extra
  41. >  characters at the end of the file, I.e. the example below should create a file 
  42. > 18 characters long including Return
  43. > But the actual file is 20 long and its these extra characters that cause the 
  44. > problem, If I load the file into a Text Editor and delete the invisible 
  45. > characters at the end and resave the file  it runs fine.
  46. > So the Question how do I create a file without the extra characters?
  47. > I have tryed CHR$(13)/CHR$(10) After A$ but no luck. 
  48. > And I can remove any extra characters easily inside Amos.
  49. > a$="workbench:data"
  50. > C$="CD "
  51. > A$=C$+A$
  52. > Open Out 3,"Ram:Datapath"
  53. > Print #3,A$
  54. > Print #3,Chr$(13)
  55. > Close 3
  56. > Any help would be appreciated
  57. > Thanks Steve.
  58. > end
  59.  
  60. The way I see it the fault MUST lie in the EOL chars. AMOS writes CRLF
  61. EOLs, whereas AmigaDOS expects LF EOLS. So you might want to do the
  62. writing this way:
  63.  
  64. Open Out 3,"ram:datapath"
  65. Print#3,A$;Chr$(10);
  66. Close 3
  67.  
  68. Remember to ALWAYS use a semicolon (;) in Print# commands if you want
  69. to write AmigaDOS readable files!
  70.  
  71. /----------------------------------------------------------------------\
  72. | Joona Palaste                             |      |  |                |
  73. | palaste@cc.helsinki.fi                    |      |  |                |
  74. | G++ FR FW+ M- #20 D+ ADA N+++ W++ B OP+   |-------  -----------------|
  75. |                                           |-------  -----------------|
  76. |                                           |      |  |                |
  77. | Finland rules! =>                         |      |  |                |
  78. \----------------------------------------------------------------------/
  79.